.TH std::operator==,!=,(std::error_code) 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::operator==,!=,(std::error_code) \- std::operator==,!=,(std::error_code)

.SH Synopsis
   Defined in header <system_error>
   bool operator==( const std::error_code& lhs,                       \fB(1)\fP \fI(since C++11)\fP
                    const std::error_code& rhs ) noexcept;
   bool operator!=( const std::error_code& lhs,                       \fB(2)\fP \fI(since C++11)\fP
                    const std::error_code& rhs ) noexcept;                \fI(until C++20)\fP
   bool operator<( const std::error_code& lhs,                        \fB(3)\fP \fI(since C++11)\fP
                   const std::error_code& rhs ) noexcept;                 \fI(until C++20)\fP
   std::strong_ordering operator<=>( const std::error_code& lhs,
                                     const std::error_code& rhs )     \fB(4)\fP \fI(since C++20)\fP
   noexcept;

   Compares two error code objects.

   1) Compares lhs and rhs for equality.
   2) Compares lhs and rhs for equality.
   3) Checks whether lhs is less than rhs.
   4) Obtains three-way comparison result of lhs and rhs.

   The <, <=, >, >=, and != operators are synthesized from operator<=>    \fI(since C++20)\fP
   and operator== respectively.

.SH Parameters

   lhs, rhs - error codes to compare

.SH Return value

   1) true if the error category and error value compare equal.
   2) true if the error category or error value compare are not equal.
   3) true if lhs.category() < rhs.category(). Otherwise, true if lhs.category() ==
   rhs.category() && lhs.value() < rhs.value(). Otherwise, false.
   4) lhs.category() <=> rhs.category() if it is not std::strong_ordering::equal.
   Otherwise, lhs.value() <=> rhs.value().

.SH See also

   category           obtains the error_category for this error_code
                      \fI(public member function)\fP
   value              obtains the value of the error_code
                      \fI(public member function)\fP
   operator==
   operator!=
   operator<          compares error_conditions and error_codes
   operator<=>        \fI(function)\fP
   (removed in C++20)
   (removed in C++20)
   (C++20)
